<template>
  <vol-box 
    :lazy="true"
    v-model="model"
    title="数据信息"
    :height="600"
    :width="1200"
    :padding="5"
    :onModelClose="onModelClose"
  >
    <div>
      <Person ref="Person"></Person>
    </div>
    <template #footer>
      <div>
        <el-button type="primary" size="small" @click="onSelect">确认</el-button >
        <!-- <el-button type="default" size="small" @click="model = false" >点击关闭弹出框</el-button > -->
      </div></template>
  </vol-box>

<!-- 批量选择明细表数据 -->
  <vol-box 
    :lazy="true"
    v-model="detailModel"
    title="批量选择明细表数据"
    :height="600"
    :width="1200"
    :padding="5"
    :onModelClose="onModelClose"
  >
    <div>
      <Person ref="Person"></Person>
    </div>
    <template #footer>
      <div>
        <el-button type="primary" size="small">确认</el-button >
        <!-- <el-button type="default" size="small" @click="model = false" >点击关闭弹出框</el-button > -->
      </div></template>
  </vol-box>
</template>
<script>
import VolBox from '@/components/basic/VolBox.vue';
import Person from '@/views/dhj/borrow/View_Borrow';
//这里使用的vue2语法，也可以写成vue3语法
export default {
  components: 
  { 'vol-box': VolBox,
    Person
  },
  methods: {},
  data() {
    return {
      model: false,
      detailModel: false
    };
  },
  methods: {
    open(){
        this.model=true;
    },
    openDetail(){
      this.detailModel=true;
    },
    onSelect(){
      let rows=this.$refs.Person.$refs.grid.getSelectRows();
      if(!rows.length){
        return this.$message.error('请选择数据');
      }
      this.$emit('parentCall', $parent =>{
        $parent.editFormFields.Item=rows[0].Item;
        $parent.editFormFields.Time=rows[0].Time;
        this.model=false;
      })
    }
  }
};
</script>
